<template>
  <!--           组件结构-->
  <div class="demo">
    <h2>学校名称{{ schoolName }}</h2>
    <h2>学校地址{{ schoolAddress }}</h2>
    <button @click="showName">点我提示学校名</button>
  </div>
</template>
<script>
// 组件交互
export default {
  name: 'school',
  data() {
    return {
      schoolName: '尚硅谷',
      schoolAddress: '北京',
    }
  },
  methods: {
    showName() {
      alert(this.schoolName)
    }
  },
}
</script>
<style>
/*组件样式*/
.demo {
  background-color: orange;
}
</style>
